<script type="text/javascript">
window.history.forward(1);
</script>
<?php 
	$res = $this->res;
	$orderid = $res->id;
	$ordercode = $res->ordercode;
	$inserttime = $res->inserttime;
	$custprice = $res->custprice;
	$transactionId = $this->transactionId;
?>
<form action="" method="post">
<input type="hidden" name="price" value="<?php echo $custprice;?>">
<input type="hidden" name="orderid" id="orderid" value="<?php echo $orderid;?>">
<input type="hidden" name="ordercode" value="<?php echo $ordercode;?>">
<input type="hidden" name="inserttime" id="inserttime" value="<?php echo $inserttime;?>">


<div class="pay_money">需支付金额<span>￥<?php echo $custprice;?></span></div>
<div class="beijin">&nbsp;</div>
<div class="pay_name">请选择支付方式</div>
<?php 
// var_dump($this->res_userinfo);
if(empty($this->res_userinfo)){
	$balance = 0;
}else{
	$balance = $this->res_userinfo->User->balance;
}
if($balance<$custprice){
	echo '
	<a href="/personal/topup">
		<div style="border-bottom:1px solid #E3E3E3;line-height:50px;height:50px;padding-left:5px;">
		<img style="width:30px;" src="/images/topupfang.png">&nbsp;余额支付<span style="color:red;font-size:0.8em;">'.$balance.'</span>
			<span style="font-size:0.8em;color:red;float:right;margin-right:20px;" tig="3">余额不足，去充值></span>
		</div>
	</a>
	';
}else{
	echo '
		<div style="border-bottom:1px solid #E3E3E3;line-height:50px;height:50px;padding-left:5px;">
			<img style="width:30px;" src="/images/topupfang.png">&nbsp;余额支付<span style="color:red;font-size:0.8em;">'.$balance.'</span>
				<span id="yue" class="pay_gouxuan" tig="3" onclick="javascript:zhifu(this);return false;"><img src="/images/gou.jpg"></span>
		</div>
	';
}
?>
<?php if (isset($_SERVER['HTTP_USER_AGENT']) && strpos($_SERVER['HTTP_USER_AGENT'], 'MicroMessenger') !== false) { ?>
	<div style="border-bottom:1px solid #E3E3E3;line-height:50px;height:50px;padding-left:5px;">
		<img style="width:30px;" src="/images/weixin.jpg">&nbsp;微信支付
			<span id="wx" class="pay_gouxuan" tig="2" onclick="javascript:zhifu(this);return false;"><img src="/images/yuan.jpg"></span>
	</div>
<?php } ?>
<div style="border-bottom:1px solid #E3E3E3;line-height:50px;height:50px;padding-left:5px;">
	<img style="width:30px;" src="/images/zhifubao.jpg">&nbsp;支付宝支付
	<span id="zfb" class="pay_gouxuan" tig="1" onclick="javascript:zhifu(this);return false;"><img src="/images/yuan.jpg"></span>
</div>

<input type="hidden" id="hid_method" value="2" name="method_zhifu">
<input type="button" id="topay" onclick="javascript:gotopay();return false;" class="cp_btn" value="去支付" style="border:0px;margin-top:60px;">
</form>               
<script type="text/javascript">
	$(document).ready(function(){
		if($('#yue').length>0){
			zhifu("#yue");
		}
		if($('#yue').length==0 &&$('#wx').length>0){
			zhifu("#wx");
		}
	});
</script>                     	
                      	
                      	
                      	
                      	
                      	
                      	
                      	
                      	
                      	
                      	
                      	
                      
                      	
                      	
                      	
                      	
                      	
                      	
                      	
                      	
                      	
                      	
                      	
                      	
                      	
                      	
